//
//  GWButton.m
//  aaacd
//
//  Created by LTOVE on 2016/12/26.
//  Copyright © 2016年 LTOVE. All rights reserved.
//

#import "GWButton.h"
#define KTITLERADIO 0.2
@implementation GWButton


#pragma 调整内部 imageView 的frame
- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat imageX = 0;
    CGFloat imageY = 0;
    CGFloat imageWidth = contentRect.size.width;
    CGFloat imageHeight = contentRect.size.height * (1-KTITLERADIO) ;
    return CGRectMake(imageX, imageY, imageWidth, imageHeight);
}

#pragma 调整内部 UIlabel 的frame
- (CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat titleX = 0;
    CGFloat titleHeight = contentRect.size.height * KTITLERADIO;
    CGFloat titleY = contentRect.size.height - titleHeight;
    CGFloat titleWidth = contentRect.size.width;
    return CGRectMake(titleX, titleY, titleWidth, titleHeight);
}

@end
